package demo.codeanalyzer.processor;

public class DataPropertyTypeWriter implements PropertyTypeWriter {

	private final PropertyPrinter propertyPrinter;

	public DataPropertyTypeWriter(PropertyPrinter propertyPrinter) {
		this.propertyPrinter = propertyPrinter;
	}

	public void endPropertyDefinition(StringBuilder objectPropertyBuilder) {
		objectPropertyBuilder.append("</owl:DatatypeProperty>").append("\n\n");
	}

	public void startPropertyDefinition(StringBuilder objectPropertyBuilder) {
		objectPropertyBuilder.append(
				String.format("<owl:DatatypeProperty %s >", propertyPrinter
						.about())).append("\n");
	}

	public void writeRangeDefinition(StringBuilder objectPropertyBuilder) {
		objectPropertyBuilder.append(
				String.format("<rdfs:range %s />", propertyPrinter
						.resource(propertyPrinter.rdfType()))).append("\n");
	}

	public void printLabel(StringBuilder objectPropertyBuilder, String label) {
		objectPropertyBuilder.append(String.format(
				"<rdfs:label>%s</rdfs:label>\n", label));
	}

}
